using UnityEngine;
using System.Collections;

public class Puppy : Damagable {

    public GameObject owner;
    void Start()
    {
        InitializeAnimationList();
        AddAnimation("idle", 0, 0, 3, .25f);
        AddAnimation("dying", 1, 0, 3, .15f);

        StartAnimation("idle", true);
        owner.GetComponent<EnemyBlackHeart>().enabled = false;
        owner.GetComponent<EnemyBlackHeart>().isDamagable = false;
    }
    protected override void OnAnimationFinished(string name)
    {
        if (name == "dying")
        {
            owner.GetComponent<EnemyBlackHeart>().enabled = true;
            owner.GetComponent<EnemyBlackHeart>().isDamagable = true;
            base.Die();
        }
    }

    protected override void Die()
    {
        SoundEffects.instance.playDogDie();
        collider.enabled = false;
        StartAnimation("dying", false);
    }
}
